<template>
  <div class="Commodity_evaluation">
	  <div class="header">
	    <van-nav-bar title="商品评论" fixed left-text="返回" right-text left-arrow @click-left="onClickLeft"/>
	  </div>
        <div class="Commodity_evaluation_div">
          <ul>
            <li v-for="(item,index) in evaluationData.list">
              <div class="Commodity_evaluation_head">
                <img :src="item.avatar"/>
                <p>{{item.nick_name}}</p>
              </div>
              <p class="Commodity_evaluation_con">{{item.create_time}}</p>
              <div style="width: 100%;">
                <p class="Commodity_evaluation_foot">{{item.content}}</p>
              </div>
            </li>
          </ul>
        </div>
	<!-- <loading v-show="bool"></loading> -->
  </div>
</template>

<style scoped>
  @import '../../assets/css/index.css';
  .loadmore{
    width:100%;
  }
</style>

<script>
  export default {
    name: 'Commodity_evaluation',

    data() {
      return {
        evaluationData:[],
        page:1,
				bool:false,
      };
    },
    watch: {

    },
    methods: {
        async onBottomLoaded(){
        //获取商品评论
          let Id= this.$route.query.id;
          let params = {
            params:{
              goodsId:Id,
              page:this.page,
              pageSize:10,
            }
          };
          const res = await this.$axios.get(this.$api.CommodityEvaluationData, params);
          if (res.success) {
            this.evaluationData = res.data;
          } else {
            this.$toast(res.msg);
          }
      },
	  //返回
	  onClickLeft() {
	    this.$router.go(-1);
	  },

    },
    mounted() {
      this.onBottomLoaded();
      this.$emit('public_footer',false);
      setTitle('评论')
    }
  };
</script>
